package com.yuxl.common.core.handler;

import lombok.Getter;
import org.springframework.http.HttpStatus;

public class ApiException extends RuntimeException{

    @Getter
    private final HttpStatus status;
    private final String message;

    public ApiException() {
        super("系统错误");
        this.message = "系统错误";
        this.status = HttpStatus.INTERNAL_SERVER_ERROR;
    }

    public ApiException(String message) {
        super(message);
        this.message = message;
        this.status = HttpStatus.INTERNAL_SERVER_ERROR;
    }

    public ApiException(HttpStatus status, String message) {
        super(message);
        this.status = status;
        this.message = message;
    }

}
